/*
 * 自定义警告信息和提示信息
 * Depends:
 * jquery.ui.js
 */
jQuery.extend({
	alert:function(txt,callback){
		var htmlAlert = '<div id="systemAlert" title="系统提示">';
		htmlAlert += '<div class="msg">' + txt + '</div></div>';
		$('body').append(htmlAlert);
		$('#systemAlert').dialog({
			bgiframe: true,
			autoOpen: true,
			modal: true,
			resizable: false,
			buttons: {
				确定: function() {
					$(this).dialog('close');
					if(jQuery.isFunction(callback)){ callback(); }
				}
			},
			close:function(){
				$('#systemAlert').dialog('destroy').remove();
			}
		});
	},
	confirm:function(txt,callback){
		var htmlConfirm = '<div id="systemConfirm" title="操作确认">';
		htmlConfirm += '<div class="msg">' + txt + '</div></div>';
		$('body').append(htmlConfirm);
		$('#systemConfirm').dialog({
			bgiframe: true,
			autoOpen: true,
			modal: true,
			resizable: false,
			buttons: {
				确定: function() {
					$(this).dialog('close');
					if(jQuery.isFunction(callback)){ callback(); }
				},
				取消: function(){
					$(this).dialog('close');
				}
			},
			close:function(){
				$('#systemConfirm').dialog('destroy').remove();
			}
		});
	}

});
